home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / patches / symantec / rtlinc.exe / INT.H < prev    next >
C/C++ Source or Header  |  1993-09-27  |  2KB  |  68 lines

  1. /*_ int.h   Tue Apr 24 1990   Modified by: Walter Bright */
  2. /* Copyright (C) 1985-1990 by Walter Bright    */
  3. /* All rights reserved                */
  4. /* Written by Walter Bright            */
  5.  
  6. /* Header for int package    */
  7.  
  8. #ifndef __INT_H
  9. #define __INT_H    1
  10.  
  11. #if __cplusplus
  12. extern "C" {
  13. #endif
  14.  
  15. #ifndef __DOS_H
  16. #include    <dos.h>
  17. #endif
  18.  
  19. /* Structure passed to interrupt service routine (see int_xxx())    */
  20.  
  21. #pragma pack(1)            /* no alignment for DOS structs    */
  22.  
  23. struct INT_DATA
  24. {
  25. #if __INTSIZE == 4
  26.     char        align;        /* dword align remainder    */
  27. #endif
  28.     unsigned        prevvec_off;    /* previous interrupt vector    */
  29.     unsigned short    prevvec_seg;
  30. #if __INTSIZE == 4
  31.     unsigned short    prevvecr_off;    /* previous real interrupt vector */
  32.     unsigned short    prevvecr_seg;
  33. #endif
  34.     unsigned        stacksize;    /* size of ISR stack        */
  35.     unsigned        newstack_off;    /* ptr to ISR stack        */
  36.     unsigned short    newstack_seg;
  37.     unsigned        oldstack_off;    /* ptr to interrupted stack    */
  38.     unsigned short    oldstack_seg;
  39. #if __COMPACT__ || __LARGE__ || __VCM__ /* sizeof(void *) > sizeof(int)    */
  40.     unsigned short    staticseg;    /* value for DS            */
  41. #endif
  42.     int        (__cdecl *funcptr)();
  43.     union REGS regs;    /* passed/returned register and flag values    */
  44.             /* (the _cflag member is garbage and is ignored) */
  45.     struct SREGS sregs;    /* passed/returned segment register values    */
  46. };
  47.  
  48. #pragma pack()
  49.  
  50. void __cdecl int_getvector(unsigned,unsigned *,unsigned *);
  51. void __cdecl int_setvector(unsigned,unsigned,unsigned);
  52. int __cdecl int_intercept(unsigned,int (__cdecl *funcptr)(struct INT_DATA *),unsigned);
  53. void __cdecl int_restore(unsigned);
  54. void __cdecl int_off(void);
  55. void __cdecl int_on(void);
  56. long __cdecl int_prev(struct INT_DATA *);
  57.  
  58. /* Inline versions of interrupt functions    */
  59. #define int_on()    __emit__(0xFB)    /* STI    */
  60. #define int_off()    __emit__(0xFA)    /* CLI    */
  61. #define int_gen(i)    __emit__(0xCD,i)    /* INT i */
  62.  
  63. #if __cplusplus
  64. }
  65. #endif
  66.  
  67. #endif /* __INT_H */
  68.